import { motion } from 'framer-motion'
import styled from '@emotion/styled'

const FeatureCard = styled(motion.div)`
  padding: 2rem;
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
`

const features = [
  {
    title: "AI Code Completion",
    description: "Write code faster with AI-powered suggestions and completions.",
    icon: "🚀"
  },
  {
    title: "Smart Refactoring",
    description: "Automatically refactor and improve your code with AI assistance.",
    icon: "⚡"
  },
  {
    title: "Natural Language Commands",
    description: "Tell Cursor what you want to do in plain English.",
    icon: "💬"
  }
]

function Features() {
  return (
    <section className="w-full py-24">
      <div className="mx-auto px-4 sm:px-6 lg:px-8">
        <motion.h2 
          className="text-center text-4xl mb-12"
          initial={{ opacity: 0, y: 20 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true }}
        >
          Powerful Features
        </motion.h2>
        
        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
          {features.map((feature, index) => (
            <FeatureCard
              key={index}
              initial={{ opacity: 0, y: 20 }}
              whileInView={{ opacity: 1, y: 0 }}
              viewport={{ once: true }}
              transition={{ delay: index * 0.1 }}
              whileHover={{ y: -5 }}
            >
              <div className="text-4xl mb-4">{feature.icon}</div>
              <h3 className="text-xl font-bold mb-2">{feature.title}</h3>
              <p className="text-[var(--text-secondary)]">{feature.description}</p>
            </FeatureCard>
          ))}
        </div>
      </div>
    </section>
  )
}

export default Features 